home *** CD-ROM | disk | FTP | other *** search
- TITLE PAUSE III
-
- CODESEG SEGMENT PARA PUBLIC 'CODE'
- ASSUME CS:CODESEG,DS:CODESEG
-
- ;_____________________________________________________________________________
- ;
- ; PAUSE3.COM
- ;
- ; A subcommand (to be used in batch files,
- ; especially when ECHO is off)
- ;
- ;
- ; This program is an improved version of DOS's PAUSE command. The
- ; problems with DOS's PAUSE command are that, when ECHO is off,
- ; it only displays one message ("Strike a key when ready . . ."),
- ; and it doesn't alert the user when it appears. This program allows
- ; users to display any message they want, which could include beeps.
- ;
- ;-----------------------------------------------------------------------------
- ;
- ;
- ; Purpose: Suspends system processing, displays a message, and
- ; waits for the user to press a character key.
- ;
- ; Format: PAUSE3 [remark]
- ;
- ; Type: Internal External
- ; ***
- ;
- ; Remarks: The remark in the PAUSE3 command is optional; it may
- ; be left out. If it is left out, the remark will be a
- ; standard "Press a key when ready . . ." Unlike DOS's
- ; PAUSE command, PAUSE3 uses the remark as the message that it
- ; will display Beeps can be put in the remark by holding down
- ; <Ctrl> and pressing the 'G' key. On screen, you should see
- ; ^G. When the message is redisplayed, a beep will replace
- ; ^G. NOTE: You cannot use the characters '>','|', and '<'
- ; in a remark. This is because they are DOS redirection
- ; symbols.
- ;
- ; Examples: Here is an example of DOS's PAUSE command:
- ;
- ; A>PAUSE This is DOS's PAUSE.
- ; Strike a key when ready . . .
- ;
- ; Here is the same example, but in a batch file which
- ; has had a previous ECHO OFF instruction:
- ;
- ; Strike a key when ready . . .
- ;
- ; Here is an example of PAUSE3:
- ;
- ; A>PAUSE3 This is PAUSE3. Press a key ==}
- ; This is PAUSE3. Press a key ==}
- ;
- ; Here is the same example, but in a batch file which
- ; has had a previous ECHO OFF instruction:
- ;
- ; This is PAUSE3. Press a key ==}
- ;
- ; Here is a PAUSE3 example with beeping in it:
- ;
- ; A>PAUSE3 You're all done! Press a key --^G^G^G
- ; You're all done! Press a key -- [beep beep beep]
- ;
- ;
- ; SEND ALL QUESTIONS AND COMMENTS TO:
- ; Scott Pakin
- ; 6007 N. Sheridan Rd.
- ; Chicago, IL 60660
- ;_____________________________________________________________________________
-
-
- ORG 100H ;MAKE THIS A .COM FILE
-
- START PROC FAR ;PROCEDURE STARTS HERE
- CLD ;DIRECTION = FORWARDS
- MOV SI,80H ;GET NUMBER OF BYTES IN MESSAGE
- MOV CL,[SI] ;FROM COMMAND LINE
- CMP CL,2 ;AT LEAST 2 BYTES LONG?
- JAE DISPMSG ;YES -- DISPLAY MESSAGE
-
- LEA DX,PRESSKEY ;SAY "PRESS A KEY WHEN READY"
- MOV AH,9
- INT 21H
- JMP GETKEY ;WAIT FOR KEYPRESS
-
- DISPMSG: INC SI ;START AT FIRST BYTE OF MESSAGE
- INC SI
- XOR CH,CH ;MAKE CL A 16-BIT NUMBER
- DEC CX ;DON'T OUTPUT CARRIAGE RETURN
- DONEXT: LODSB ;GET A CHARACTER
- MOV DL,AL ;OUTPUT CHARACTER
- MOV AH,2
- INT 21H
- LOOP DONEXT ;GET NEXT CHARACTER
-
- GETKEY: MOV AH,0CH ;CLEAR KEYBOARD BUFFER
- MOV AL,1 ;AND WAIT FOR A KEY TO BE PRESSED
- INT 21H ;(WITH CTRL-BREAK CHECK)
-
- MOV AH,2 ;DISPLAY A
- MOV DL,13 ;CARRIAGE RETURN
- INT 21H ;AND
- MOV DL,10 ;A LINEFEED
- INT 21H ;
- INT 20H ;RETURN TO DOS
-
- PRESSKEY DB 'Press a key when ready . . . $'
- START ENDP
- CODESEG ENDS
- END START